package com.crm.user.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.user.dao.UserInfoDao;
import com.crm.user.model.UserInfo;
@Repository("userInfoDao")
public class UserInfoDaoImpl extends BaseDao implements UserInfoDao {
	
	private static final String MAPPER_NAMESAPCE = "UserInfoMapper.";

	@Override
	public UserInfo selectUserInfoByUid(Long uid) {
		return selectOne(MAPPER_NAMESAPCE+"selectUserInfoByUid", uid);
	}

	@Override
	public UserInfo insert(UserInfo userinfo) {
		insert(MAPPER_NAMESAPCE+"insert", userinfo);
		return userinfo;
	}

	@Override
	public List<UserInfo> selectAllUserinfoByDeptId(Long deotid) {
		List<UserInfo> list = selectList(MAPPER_NAMESAPCE+"selectAllUserinfoByDeptId", deotid);
		return list;
	}

	@Override
	public int updateUserInfo(UserInfo userinfo) {
		return update(MAPPER_NAMESAPCE+"updateInfoByUid", userinfo);
	}

	@Override
	public List<UserInfo> getUserInfoListWithDept() {
		return selectList(MAPPER_NAMESAPCE+"getUserInfoListWithDept");
	}

}
